package com.qing.demo.netty.util;

import cn.hutool.json.JSONUtil;
import com.qing.demo.netty.domain.MsgAgreement;

/**
 * @author caozhipeng
 * @date 2025/8/7
 */
public class MsgUtil {

    public static MsgAgreement buildMsg(String toChannelId,String content){
        return new MsgAgreement(toChannelId,content);
    }

    public static MsgAgreement json2Obj(String objJsonStr){
        return JSONUtil.toBean(objJsonStr,MsgAgreement.class);
    }

    public static String obj2Json(MsgAgreement obj){
        return JSONUtil.toJsonStr(obj)+ "\r\n";
    }
}
